const mysql2=require('mysql2')

const{
    DATABASE_HOST,
    DATABASE_PORT,
    DATABASE_USER,
    DATABASE_PASSWORD,
    DATABASE_NAME
}=require('./env')

const pool=mysql2.createPool({
    host:DATABASE_HOST,
    port:DATABASE_PORT,
    user:DATABASE_USER,
    password:DATABASE_PASSWORD,
    database:DATABASE_NAME
})

module.exports=pool.promise()